package com.allprs.hmcs.enums;

import com.allprs.hmcs.pojo.resBo.BaseMap;

/**
 * 数据类型枚举
 */
public enum NaturalTypeEnum {

    RIVER("1", "江河湖泊"),

    CANAL("2", "港渠"),

//    LAKE("3", "湖泊"),

    CULVERT("4", "涵闸"),

    PUMP_STATION("5", "泵站"),

    PIPE("6", "管网"),

    DAM("7", "堤防"),

    CATCHMENT("8", "汇水分区");
    private final String code;
    private final String desc;

    NaturalTypeEnum(String code, String desc)
    {
        this.code = code;
        this.desc = desc;
    }

    public String getCode()
    {
        return code;
    }

    public String getDesc()
    {
        return desc;
    }


    public static String getDescByCode(String code){
        String desc = "";
        for (NaturalTypeEnum ele : values()) {
            if(ele.getCode().equals(code)){
                desc =  ele.getDesc();
            }
        }
        return desc;
    }

    /**
     * 将枚举转换成key-value的vo
     * @return
     */
    public BaseMap toBaseMap() {
        return new BaseMap(code, desc);
    }
}
